package b_lambda;

public class MyInterface2Impl {
    public static String method1(MyInterface2 in){
        String str = in.echo("hello");
        return str;
    }


    public static void main(String[] args) {
        //method1();

        //以前的写法
        method1(new MyInterface2() {
            @Override
            public String echo(String str) {
                return str;
            }
        });

        //优化:
        method1(str -> str);
    }
}
